import service from '@/utils/request'
// 获取809info
export function getJt809UserList(params) {
  return service.get('/api/jt809/list', {
    params
  })
}
export function addJt809Plat(data) {
  return service.post('/api/jt809/save', data)
}
export function updateJt809Plat(data) {
  return service.put('/api/jt809/update', data)
}
export function deleteJt809Plat(gnssIds) {
  return service.delete(
    '/api/jt809/delete',
    {
      params: {
        gnssIds
      }
    }
    // paramsSerializer: function (params) {
    //   return qs.stringify(params, { arrayFormat: 'repeat' })
    // }
  )
}
export function getJt809SessionInfoList(params) {
  return service.get('/gps/jt809_user/allSessionInfo', {
    params
  })
}
export function connectApi(gnssId, processMainConn) {
  return service.put('/gps/jt809_user/startSession?gnssId=' + gnssId + "&processMainConn=" + processMainConn)
}
export function disConnect(gnssId, processMainConn) {
  return service.put('/gps/jt809_user/closeSession?gnssId=' + gnssId + "&processMainConn=" + processMainConn)
}
export function jt809GenerateAccount() {
  return service.get('/gps/jt809_uaer/genAccount')
}
export function jt809LogList(params) {
  return service.get('/gps/jt809_user/log/list', {
    params
  })
}
